#ifndef CAFFEINE_UTILITY_PROPERTYPARSER_HPP
#define CAFFEINE_UTILITY_PROPERTYPARSER_HPP

#include <fstream>
#include <list>
#include <string>

namespace Utility
{
	enum FieldType
	{
		TOKEN_STRING_OPEN = 0,
		TOKEN_STRING_VALUE,
		TOKEN_STRING_CLOSE,
		TOKEN_PROPERTY_FIELD_BEGIN,
		TOKEN_PROPERTY_ASSIGN,
		TOKEN_PROPERTY_NEXT,
		TOKEN_PROPERTY_FIELD_CLOSE
	};

	struct FieldVal
	{
		int Type;
		std::string Value;
	};

	class PropertyParser
	{
	public:
		PropertyParser( const std::string path );
		~PropertyParser( void );
	private:
		int Tokenise( const char c );
		void PreProcess( void );
		void Parse( void );

		bool commentOpen;
		bool quoteOpen;
		std::list< FieldVal > preprocessed;
		std::ifstream file;
		
	};
}

#endif //CAFFEINE_UTILITY_PROPERTYPARSER_HPP